<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes"
           uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<stripes:useActionBean beanclass="org.jboss.as.quickstarts.login.stripes.LoginActionBean" var="bean"/>
<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Login</title>
</head>

<body lang="en">
<stripes:messages/>
<stripes:errors/>

<c:choose>
    <c:when test="${bean.loggedIn}">
        <p>Log out</p>
        <stripes:form beanclass="org.jboss.as.quickstarts.login.stripes.LoginActionBean">
            <stripes:submit name="logout"/>
        </stripes:form>
    </c:when>
    <c:otherwise>
        <fieldset>
            <legend>Log in</legend>
            <stripes:form beanclass="org.jboss.as.quickstarts.login.stripes.LoginActionBean">
                <table>
                    <tbody>
                    <tr>
                        <td>Username:</td>
                        <td><stripes:text name="credentials.username"/></td>
                    </tr>
                    <tr>
                        <td>Password:</td>
                        <td><stripes:password name="credentials.password"/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><stripes:submit name="login"/></td>
                    </tr>
                    </tbody>
                </table>
            </stripes:form>
        </fieldset>
    </c:otherwise>
</c:choose>
</body>
</html>